/**
 * 
 */
package view.impl.ingame.animation;

import org.newdawn.slick.Animation;



/**
 * @author Julian
 *
 */
public abstract class ActionAnimation {
	protected Animation anim = null;
	protected boolean mirrored = false;
	private int offsetX = 0;
	private int offsetY = 0;
	
	ActionAnimation(Animation anim, int offsetX, int offsetY, boolean mirrored) {
		this.anim = anim;
		this.mirrored = mirrored;
		this.offsetX = mirrored ? -offsetX : offsetX;
		this.offsetY = mirrored ? -offsetY : offsetY;
	}

	public void draw(float posX, float posY, float width, float height) {
		anim.draw(posX + offsetX, posY + offsetY, width, height);
	}

	public abstract EActionType getActionType();
	
	public boolean isStopped() {
		return anim.isStopped();
	}

	public void start() {
		anim.start();
	}

	public void stop() {
		anim.stop();
	}

	public int getHeight() {
		return anim.getHeight();
	}

	public int getWidth() {
		return anim.getWidth();
	}

	public void restart() {
		anim.restart();
	}
}
